package com.ziiwee.reduce.describe.creators.controllers;

import com.ziiwee.reduce.describe.AbstractDescribe;
import com.ziiwee.reduce.describe.ControllerDescribe;
import com.ziiwee.reduce.describe.creators.ControllerDescribeCreator;
import com.ziiwee.reduce.describe.models.ControllerDescribeModel;
import com.ziiwee.reduce.describe.utils.DescribeUtil;

/**
 * @author ziiwee
 * @data 2020/8/12
 */
public abstract class AbstractControllerDescribeCreator extends AbstractDescribe implements ControllerDescribeCreator, ControllerDescribe {


    @Override
    public String getName() {
        return DescribeUtil.getSimpleNameByResolvableType(getType());
    }

    @Override
    public String getId() {
        return getType().toString();
    }


    @Override
    public ControllerDescribe create() {
        return new ControllerDescribeModel(getName(), getType(), getLabel(), getDescription(), getSubjectType(), getHandlers(), getId());
    }


}
